import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import WindiCSS from 'vite-plugin-windicss';
import MiniProgramTailwind from '@dcasia/mini-program-tailwind-webpack-plugin/rollup';
import {
	resolve
} from 'path'
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		uni(),
		WindiCSS(),
		MiniProgramTailwind()
	],
	server: {
		proxy: {
			'/api': {
				// target: 'https://aw2025ht.kangye.xyz',
				target: 'http://localhost:8088',
				changeOrigin: true,
				// rewrite: (path) => path.replace(/^/, '')
				rewrite: (path) => path.replace(/^\/api/, '')
			}

		}
	},
	build: {
		rollupOptions: {
			external: ['uview-ui'], // 添加这行来将 uview-ui 作为外部依赖
		},
	},
})